<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/admin/user/adduser" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page">
    <div class="page-hd">
      <h1>
        <if condition="isset($res)">{$Think.lang.update}{$Think.lang.user}
          <else />{$Think.lang.addUser}</if>
      </h1>
    </div>
    <!-- <div class="section-hd">
          <if condition="isset($res)">
            <h3 class="section-ti">{$Think.lang.editorUserManageGroup}</h3>
          <else/>
            <h3 class="section-ti">{$Think.lang.addUser}</h3>
          </if>
        </div> -->
    <div class="form">
      <if condition="isset($res)">
        <form action="{:URL('admin/User/editUser')}" id="J_form_edit" method="post">
          <else />
          <form action="{:URL('admin/User/addUserManage')}" id="J_form_add" method="post">
      </if>
      <dl class="kv">
        <input type="hidden" value="{$res.uid}" name="uid" />
        <dt>
          <label>{$Think.lang.email}：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="email" id="email" value="{$res.email}" required />
          <span class="required">*</span>
          <div class="kv-error"></div>
          <p class="tip">邮箱主要用于PC端用户注册，登陆</p>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.手机号码}：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="phone" id="phone" value="{$res.phone}" required/>
          <span class="required">*</span>
          <div class="kv-error"></div>
          <p class="tip">手机号码主要用于手机端应用用户注册，登陆</p>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.password}：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="password" id="password" <empty name="res">required</empty>/>
          <empty name="res">
            <span class="required">*</span>
            <div class="kv-error"></div>
          </empty>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.nickname}：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="nickname" id="nickname" value="{$res.uname}" required />
          <span class="required">*</span>
          <div class="kv-error"></div>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.personalizedDomainName}：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="domain" value="{$res.domain}" />
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.sex}：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" name="sex" value="1" <eq name="res.sex" value="1">checked</eq>
            >{$Think.lang.male}&nbsp;</label>
          <label>
            <input type="radio" name="sex" value="0" <neq name="res.sex" value="1">checked</neq>
            >{$Think.lang.female}</label>
        </dd>
      </dl>
      <volist name="alist" id="alist">
        <dl class="kv">
          <dt>
            <label>{$alist.alias}：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="{$alist.name}" value="{$cu[$alist['name']]}" onkeydown="KeyCodeOnlyNumber();" />
          </dd>
        </dl>
      </volist>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.isActive}：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" name="isActive" value="1" <eq name="res.is_active" value="1">checked</eq>
            >{$Think.lang.active}&nbsp;</label>
          <label>
            <input type="radio" name="isActive" value="0" <neq name="res.is_active" value="1">checked</neq>
            >{$Think.lang.notActive}</label>
        </dd>
      </dl>
       <dl class="kv">
        <dt>
          <label>用户等级：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" name="admin_level" value="0" <eq name="res.admin_level" value="0">checked</eq>
            >普通用户&nbsp;</label>
          <label>
            <input type="radio" name="admin_level" value="1" <eq name="res.admin_level" value="1">checked</eq>
            >管理员</label>
          <label>
            <input type="radio" name="admin_level" value="2" <eq name="res.admin_level" value="2">checked</eq>
            >企业用户&nbsp;</label>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>{$Think.lang.userGroupManage}：</label>
        </dt>
        <dd>
          <volist name="list" id="vo">
            <input type="checkbox" id="group_{$vo['id']}" name="group[]" value="{$vo['id']}" <eq name="vo.is_user_role" value="yes">checked</eq> >{$vo['name']}
            <br />
          </volist>
          <empty name="list">
            <br />
          </empty>
        </dd>
      </dl>
      <div class="actions">
        <if condition="isset($res)">
          <input class="btn btn-y" type="submit" value="{$Think.lang.update}{$Think.lang.user}" />
          <else />
          <input class="btn btn-y" type="submit" value="{$Think.lang.add}{$Think.lang.user}" />
        </if>
        <a href="{:URL('admin/User/user')}" class="btn btn-n btn">{$Think.lang.cancel}</a>
      </div>
      </form>
    </div>
  </div>
</body>

</html>
